<div class="row justify-content-center">
    <div class="col-8">
        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
            <h2 id="jhi-temporary-position-heading">Create or edit a Temporary Position</h2>
            <div>
                <jhi-alert-error></jhi-alert-error>
                <div class="form-group" [hidden]="!temporaryPosition.id">
                    <label for="id">ID</label>
                    <input type="text" class="form-control" id="id" name="id"
                        [(ngModel)]="temporaryPosition.id" readonly />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_openId">Open Id</label>
                    <input type="text" class="form-control" name="openId" id="field_openId"
                        [(ngModel)]="temporaryPosition.openId" required/>
                    <div [hidden]="!(editForm.controls.openId?.dirty && editForm.controls.openId?.invalid)">
                        <small class="form-text text-danger"
                        [hidden]="!editForm.controls.openId?.errors?.required">
                        This field is required.
                        </small>
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_positionX">Position X</label>
                    <input type="text" class="form-control" name="positionX" id="field_positionX"
                        [(ngModel)]="temporaryPosition.positionX" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_positionY">Position Y</label>
                    <input type="text" class="form-control" name="positionY" id="field_positionY"
                        [(ngModel)]="temporaryPosition.positionY" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" for="field_time">Time</label>
                    <div class="d-flex">
                        <input id="field_time" type="datetime-local" class="form-control" name="time" [(ngModel)]="time" placeholder="YYYY-MM-DD HH:mm"
                        />
                    </div>
                </div>

            </div>
            <div>
                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span>Cancel</span>
                </button>
                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span>Save</span>
                </button>
            </div>
        </form>
    </div>
</div>
